﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpRenderingInterface.h"

namespace gcmp
{
    class IColorBlender;
    class IPreHighlightSetting;
    class IHighlightSetting;
    struct Color;
    class ITransparentFaceOcclusionModeSetting;
    class IDocument;
    class IModelView;
    class ElementId;
    class IForegroundElementHandler;
    class IBatchLoadHandler;

    /// \brief 预高亮类型
    enum class PreHighlightType : int32_t
    {
        PrehighlightGraphicsElementShape = 0,    ///< 预高亮整个GraphicsElementShape
        PrehighlightFace = 1,                    ///< 预高亮GraphicsElementShape中的某个面
        PrehighlightEdge = 2,                    ///< 预高亮GraphicsElementShape中的某个边
    };

    /// \brief隐藏线可见性处理类
    class GCMP_RENDERING_INTERFACE_EXPORT IHiddenLineVisibilityHandler
    {
    public:
        /// \brief 判断element的隐藏线是否绘制
        ///
        /// \param[in] pModelView 视图指针
        /// \param[in] eleId 待获取信息的element
        /// \return isVisible 返回参数，是否可见
        virtual bool IsHiddenLineVisible(const IModelView& pModelView, const ElementId & elementId) = 0;
    };


    /// \brief 视觉效果管理器类
    class GCMP_RENDERING_INTERFACE_EXPORT IVisualEffectManager
    {
    public:
        /// \brief 析构函数
        virtual ~IVisualEffectManager();

        /// \brief 获取视觉效果管理器
        ///
        /// \return 全局视觉效果管理器指针
        static IVisualEffectManager* Get();

        /// \brief 设置颜色混合器
        virtual void SetColorBlender(OwnerPtr<IColorBlender> colorBlender) = 0;

        /// \brief 获取颜色混合器
        ///
        /// \return 颜色混合器
        virtual const IColorBlender* GetColorBlender() const = 0;

        /// \brief 获取颜色混合器
        ///
        /// \return 颜色混合器
        virtual IColorBlender* GetColorBlender() = 0;

        /// \brief 设置面透明配置
        virtual void SetFaceTransparentSetting(OwnerPtr<ITransparentFaceOcclusionModeSetting> transparentSetting) = 0;

        /// \brief 获取面透明配置
        ///
        /// \return 面透明配置
        virtual const ITransparentFaceOcclusionModeSetting* GetFaceTransparentSetting() const = 0;

        /// \brief 获取预高亮属性设置
        /// \param type 预高亮类型
        /// \return 预高亮属性设置
        virtual const IPreHighlightSetting* GetPreHighlightSetting(PreHighlightType type) const = 0;

        /// \brief 获取预高亮属性设置
        /// \param type 预高亮类型
        /// \return 预高亮属性设置
        virtual IPreHighlightSetting* GetPreHighlightSetting(PreHighlightType type) = 0;

        /// \brief 获取高亮属性设置
        /// \return 高亮属性设置
        virtual IHighlightSetting* GetHighlightSetting() = 0;

        /// \brief 获取预高亮的颜色
        /// \return 预高亮的颜色
        virtual Color GetPreHighlightColor() const = 0;

        /// \brief 设置预高亮的颜色
        /// \param color 预高亮的颜色
        virtual void SetPreHighlightColor(const Color& color) = 0;

        /// \brief 设置隐藏线见性处理器
        /// \param pHiddenLineVisibilityHandler 隐藏线处理器
        virtual void SetHiddenLineVisibilityHandler(OwnerPtr<IHiddenLineVisibilityHandler> opHiddenLineVisibilityHandler) = 0;

        /// \brief 获取隐藏线见性处理器
        /// \return pHiddenLineVisibilityHandler 隐藏线处理器
        virtual IHiddenLineVisibilityHandler* GetHiddenLineVisibilityHandler() = 0;

        /// \brief 设置切平面前景Element处理器
        /// \param opForegroundElementHandler 切平面前景Element处理器
        virtual void SetForegroundElementHandler(OwnerPtr<IForegroundElementHandler> opForegroundElementHandler) = 0;

        /// \brief 获取切平面前景Element处理器
        /// \return 切平面前景Element处理器
        virtual const IForegroundElementHandler* GetForegroundElementHandler() const = 0;

        /// \brief 设置启动或者关闭前景功能
        /// \param isForegroundFunctionEnabled 设置true（启动）或false（关闭）前景功能
        virtual void EnableForegroundFunction(bool isForegroundFunctionEnabled) = 0;

        /// \brief 获取是否开启前景功能
        /// \return true支持前景功能，false不支持前景功能
        virtual bool IsForegroundFunctionEnabled() const = 0;

        /// \brief 设置分批加载处理器
        /// \param opBatchRenderGrepsManager 分批加载处理器
        virtual void SetBatchRenderGrepManager(OwnerPtr<IBatchLoadHandler> opBatchRenderGrepsManager) = 0;

        /// \brief 获取分批加载处理器
        /// \return 分批加载处理器
        virtual IBatchLoadHandler* GetBatchRenderGrepManager() = 0;

    };
}

